package org.firecloud.h5fun.model.javabean;

public class SearchQueryBean {
	public static final byte OrderByType_ID = 1;
	public static final byte OrderByType_CLICK = 11;
	public static final byte OrderByType_COMMENTARY= 10;
	
	/**
	 * 搜索文本
	 */
	private String str = null;
	/**
	 * 搜索栏目
	 */
	private byte columnId = 0;
	/**
	 * 是否逆序
	 */
	private byte desc = 0;
	/**
	 * 排序根据
	 */
	private byte orderBy = 0;
	
	public byte getDesc() {
		return desc;
	}
	public void setDesc(byte desc) {
		this.desc = desc;
	}
	public String getStr() {
		return str;
	}
	public void setStr(String str) {
		this.str = str;
	}
	public byte getColumnId() {
		return columnId;
	}
	public void setColumnId(byte columnId) {
		this.columnId = columnId;
	}
	
	public byte getOrderBy() {
		return orderBy;
	}
	public void setOrderBy(byte orderBy) {
		this.orderBy = orderBy;
	}
	@Override
	public String toString() {
		return "SearchQueryBean [str=" + str + ", columnId=" + columnId + ", desc=" + desc + ", orderBy=" + orderBy
				+ "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + columnId;
		result = prime * result + desc;
		result = prime * result + orderBy;
		result = prime * result + ((str == null) ? 0 : str.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SearchQueryBean other = (SearchQueryBean) obj;
		if (columnId != other.columnId)
			return false;
		if (desc != other.desc)
			return false;
		if (orderBy != other.orderBy)
			return false;
		if (str == null) {
			if (other.str != null)
				return false;
		} else if (!str.equals(other.str))
			return false;
		return true;
	}
	
}
